set curDir=`cd`
set appDir="${curDir}\..\..\.."
set newJar="${appDir}\DCEdit.jar"
set jarManifest="${curDir}\manifest.txt"
set libDir="${appDir}\lib\*"
set binDir="${appDir}\bin\classes\*"
set tempDir="${appDir}\PostCompile_Temp"

echo "Creating temporary directory."
touch ${tempDir}
rm -rf ${tempDir}
mkdir ${tempDir}

echo "Changing location to temporary directory."
cd ${tempDir}

echo "Unpacking JAR files."
for file in `/usr/bin/li ${libDir}`
do
	jar xvf "${libDir}/${file}"
done

echo "Copying appliation classes to temporary directory."
cp -r ${binDir} .

echo Removing existing DCEdit.jar file.
rm -f %newJar%

echo "Packing JAR contents into single file.  This may take a few minutes."
jar cfm ${newJar} ${jarManifest} com dcedit META-INF org resource sun tools

echo "Removing temporary directory."
cd ${appDir}
rm -rf ${tempDir}